package com.hmall.search.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.hmall.common.dto.PageDTO;
import com.hmall.search.pojo.ItemDoc;
import com.hmall.search.pojo.RequestParams;
import org.springframework.web.bind.annotation.RequestParam;

import java.io.IOException;
import java.util.List;
import java.util.Map;

public interface ISearchService {

    /**
     * 自动补全
     * @param prefix
     * @return
     */
    List<String> getCompletion(String prefix) throws IOException;



    /**
     * 基础查询功能
     * @param requestParams
     * @return
     */
    PageDTO<ItemDoc> select(RequestParams requestParams) throws IOException;

    /**
     * 查询过滤项
     * @param requestParams
     * @return
     */
    Map<String, List<String>> getFilters(RequestParams requestParams) throws IOException;

    //上架
    void upItem(Long id) throws IOException;

    //下架
    void downItem(Long id) throws IOException;
}
